package com.hi.hiparty.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;

import com.hi.hiparty.R;
import com.hi.hiparty.ui.fragment.PartyThemeListFragment;
import com.hi.hiparty.ui.fragment.PartyThemeListFragment.OnThemeSelectedListener;

public class PartyThemePickerActivity extends FragmentActivity implements
		OnThemeSelectedListener {

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.party_theme_picker);

		if (savedInstanceState == null) {
			FragmentTransaction ft = getSupportFragmentManager()
					.beginTransaction();
			PartyThemeListFragment fragment = new PartyThemeListFragment();
			fragment.setOnThemeSelectedListener(this);
			ft.add(R.id.theme_list, fragment);
			ft.commit();
		}
	}

	@Override
	public void onThemeSelected(String themeid) {
		Intent localIntent = new Intent();
		localIntent.putExtra("theme_id", themeid);
		setResult(RESULT_OK, localIntent);
		finish();
	}

}
